<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_quiz_result".
 *
 * @property string $id 主键
 * @property string $quiz_id 测验id
 * @property string $begin_time 开始答题时间
 * @property string $end_time 提交答案时间
 * @property string $status 状态(答题中/提交/批阅中/)
 * @property double $score 分数
 * @property int $answer_ques_num 答题数
 * @property int $total_ques_num 总题数
 * @property string $is_invalid 是否有效
 * @property string $is_evaluated 是否已经评阅
 * @property int $time_left 剩余时间
 * @property string $create_by 答题者
 * @property string $create_time 创建时间
 * @property string $update_by
 * @property string $update_time
 * @property int $del_flag
 */
class TQuizResult extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_quiz_result';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'create_time'], 'required'],
            [['begin_time', 'end_time', 'create_time', 'update_time'], 'safe'],
            [['score'], 'number'],
            [['answer_ques_num', 'total_ques_num', 'time_left', 'del_flag'], 'integer'],
            [['id', 'quiz_id', 'create_by', 'update_by'], 'string', 'max' => 36],
            [['status', 'is_invalid', 'is_evaluated'], 'string', 'max' => 64],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'quiz_id' => 'Quiz ID',
            'begin_time' => 'Begin Time',
            'end_time' => 'End Time',
            'status' => 'Status',
            'score' => 'Score',
            'answer_ques_num' => 'Answer Ques Num',
            'total_ques_num' => 'Total Ques Num',
            'is_invalid' => 'Is Invalid',
            'is_evaluated' => 'Is Evaluated',
            'time_left' => 'Time Left',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
        ];
    }
}
